package com.skyolder.milkbee.service;

import com.skyolder.milkbee.domain.Sweepstake;
import com.skyolder.milkbee.domain.SweepstakeExt;
import com.skyolder.milkbee.repository.SweepstakeExtRepository;
import com.skyolder.milkbee.repository.SweepstakeRepository;
import com.skyolder.milkbee.service.dto.SweepstakeDTO;
import com.skyolder.milkbee.service.mapper.SweepstakeMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;

import javax.inject.Inject;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Service Implementation for managing Sweepstake.
 */
@Service
@Transactional
public class SweepstakeExtService {

    private final Logger log = LoggerFactory.getLogger(SweepstakeExtService.class);
    
    @Inject
    private SweepstakeExtRepository sweepstakeExtRepository;


    @Transactional(readOnly = true) 
    public Page<SweepstakeExt> findAll(Pageable pageable) {
        log.debug("Request to get all Sweepstakes");
        Page<SweepstakeExt> result = sweepstakeExtRepository.findAll(pageable);
        return result;
    }

    @Transactional(readOnly = true) 
    public SweepstakeExt findOne(Long id) {
        log.debug("Request to get Sweepstake : {}", id);
        SweepstakeExt sweepstake = sweepstakeExtRepository.findOne(id);
        return sweepstake;
    }


}
